import request from '@/utils/request'

//解析Shp文件--typeCode为zqfw时 是获取（划定评估子区页面）灾区范围数据并保存;typeCode为disasterArea时 是获取（灾区范围页面）灾区范围数据并保存
export function getListsShp (query) {
  /*query = {
    fileIds:"",
    typeCode:""
  }*/
  return request({
    url: '/shpDataControl/parseShp',
    method: 'get',
    params: query,
  })
}

//根据事件ID、空间数据查询灾区范围列表（划定评估子区页面）
export function getSeismicInfluenceList (xsemId,geom) {
  let query = {
    xsemId:xsemId,
    geom:geom
  }
  return request({
    url: '/shpDataControl/getSeismicInfluenceList',
    method: 'post',
    data: query,
  })
}

//根据事件ID、空间数据查询灾区范围列表（灾区范围页面）
export function getDisasterSeismicInfluenceList (xsemId,geom) {
  let query = {
    xsemId:xsemId,
    geom:geom
  }
  return request({
    url: '/shpDataControl/getDisasterSeismicInfluenceList',
    method: 'get',
    params: query,
  })
}

//根据事件ID、空间数据查询地震烈度图范围列表（地震烈度图绘制页面）
export function getDrawSeismicInfluenceList (xsemId,geom) {
  let query = {
    xsemId:xsemId,
    geom:geom
  }
  return request({
    url: '/shpDataControl/getDrawSeismicInfluenceList',
    method: 'get',
    params: query,
  })
}

//根据事件ID、空间数据查询任务列表
export function getSurTaskManageList (xsemId,geom,type) {
  let query = {
    xsemId:xsemId,
    geom:geom,
    type: type
  }
  return request({
    url: '/shpDataControl/getSurTaskManageList',
    method: 'get',
    params: query,
  })
}
//根据事件ID、空间数据查询任务列表 更新
export function getInvTaskManageList (xsemId,geom,) {
  let query = {
    xsemId:xsemId,
    geom:geom
  }
  return request({
    url: '/shpDataControl/getInvTaskManageList',
    method: 'get',
    params: query,
  })
}


//获取字段说明 typeCode为zqfw时 是获取灾区范围数据
export function getFileDesc (typeCode) {
  return request({
    url: '/shpDataControl/getFileDesc/'+typeCode,
    method: 'get'
  })
}

//根据事件ID逻辑删除地震烈度图范围（地震烈度图绘制页面）
export function deleteDrawSeismicInfluence (xsemId) {
  let data = {
    xsemId:xsemId
  }
  return request({
    url: '/shpDataControl/deleteDrawSeismicInfluence',
    method: 'post',
    data: data
  })
}

//根据事件ID、烈度逻辑删除地震烈度图范围（地震烈度图绘制页面）
export function deleteDrawSeismicInfluenceByIntensity (xsemId,intensity) {
  let data = {
    xsemId:xsemId,
    intensity:intensity
  }
  return request({
    url: '/shpDataControl/deleteDrawSeismicInfluenceByIntensity',
    method: 'post',
    data: data
  })
}

//根据事件ID、烈度逻辑删除地震烈度图范围（地震烈度图绘制页面）
export function deleteDrawSeismicInfluenceById (siId) {
  let data = {
    siId:siId
  }
  return request({
    url: '/shpDataControl/deleteDrawSeismicInfluenceById',
    method: 'post',
    data: data
  })
}

//根据烈度保存地震烈度图（地震烈度图绘制页面）
export function saveDrawSeismicInfluenceByIntensity (siId,xsemId,intensity,geom,remark,coords) {
  let data = {
    siId:siId,
    xsemId:xsemId,
    intensity:intensity,
    geom:geom,
    remark:remark,
    coords:coords
  }
  return request({
    url: '/shpDataControl/saveDrawSeismicInfluenceByIntensity',
    method: 'post',
    data: data
  })
}

//计算全部烈度空间数据及面积（地震烈度图绘制页面）
export function countAllDrawSeismicInfluenceGeom (xsemId,bool) {
  let query = {
    xsemId:xsemId,
    bool:bool
  }
  return request({
    url: '/shpDataControl/countAllDrawSeismicInfluenceGeom',
    method: 'get',
    params: query
  })
}